﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace Xqsys.DAL
{
    public class JobType
    {
        /// <summary>
        /// 增加工作类型
        /// </summary>
        /// <param name="jobType"></param>
        /// <returns>bool</returns>
        public bool AddJobType(MODEL.JobType jobType)
        {
            SqlParameter[] param = new SqlParameter[]            {                new SqlParameter("@jobname",jobType.JobName)            };
            return COM.SqlHelper.ExecuteNonQuery("sp_AddJobType", param);
        }
        /// <summary>
        /// 查找工作类型名称
        /// </summary>
        /// <param name="jobType"></param>
        /// <returns>所有</returns>
        public DataSet SelectJob(MODEL.JobType jobType)
        {
            SqlParameter[] param = new SqlParameter[]            {                new SqlParameter("@jobID",jobType.JobID)            };
            return COM.SqlHelper.ExecuteQuery("sp_SelectJob", param);
        }
        /// <summary>
        /// 判断工作类型是否存在
        /// </summary>
        /// <param name="jobType"></param>
        /// <returns>bool</returns>
        public bool ExistJobID(MODEL.JobType jobType)
        {
            SqlParameter[] param = new SqlParameter[]            {                new SqlParameter("@jobID",jobType.JobID)            };
            return COM.SqlHelper.ExecuteNonQuery("sp_SelectJobType", param);
        }
    }
}

